package com.holly.unit.es.util;

/**
 * 类描述: Es服务地址处理工具类
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/4/2 14:14
 */
public class EsBaseUrlUtil {

    public static StringBuilder getBaseUrl(String indexName, String typeName,String baseUrl) {
        typeName = typeName.trim().toLowerCase();
        return getBaseUrl(indexName,baseUrl).append("/").append(typeName);
    }

    public static StringBuilder getBaseUrl(String indexName,String baseUrl) {
        indexName = indexName.trim().toLowerCase();
        return getBaseUrl(baseUrl).append("/").append(indexName);
    }

    public static StringBuilder getBaseUrl(String baseUrl) {
        return new StringBuilder("http://").append(baseUrl);
    }

}
